﻿<phone:PhoneApplicationPage
    xmlns:wb="clr-namespace:QuickTasks"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:local="clr-namespace:QuickTasks"
    x:Class="QuickTasks.MainPage" 
    xmlns:abt1="clr-namespace:CommonControls"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" Loaded="PhoneApplicationPage_Loaded">


 

    <phone:Panorama  x:Name="PanoramaMain">

        <phone:Panorama.Title>
            <StackPanel Margin="0,80,0,0" Orientation="Horizontal" Height="150">
                <Image x:Name="imgLogo" Source="/Images/logo.png" Margin="10,25,10,0" Width="101" Height="132" VerticalAlignment="Center"/>
                <TextBlock x:Name="PanoramaTitle" Text="quick tasks" Margin="20,0,0,-2" FontSize="110" FontFamily="Segoe WP" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            </StackPanel>
        </phone:Panorama.Title>

        <!--Favorite people page-->
        <phone:PanoramaItem x:Name="PanoramPeople">
            <phone:PanoramaItem.Header>
                <ContentControl>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="people" Foreground="White" ></TextBlock>

                        <wb:ThemeableImage Margin="120,20,0,0"  Source="/Images/appbar.add.rest.png" Width="48" Height="48" MouseLeftButtonDown="imgAddContacts_MouseLeftButtonDown"/>
                    </StackPanel>
                </ContentControl>
            </phone:PanoramaItem.Header>
            <Grid>
                <ListBox x:Name="lbxFavoritePeople" ItemsSource="{Binding}" Margin="12,0,0,0"  SelectionChanged="lbxFavoritePeople_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Height="90" >
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>

                                        <toolkit:MenuItem Header="delete" Click="MenuItem_Click_3" Foreground="White"/>
                                        <toolkit:MenuItem Header="change location" Click="peoplechangeLocation_click" Foreground="White"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                                <TextBlock Foreground="White" Text="{Binding Name}" FontSize="28"  Width="160" VerticalAlignment="Top" />
                                <wb:ThemeableImage Source="Images/Personal.png"  Tag="{Binding Id}" Width="48" Height="48" Margin="10,0,0,0" VerticalAlignment="Top"  Visibility="{Binding mobileVisibility}" MouseLeftButtonDown="imgPersonal_Click"   />
                               
                                <wb:ThemeableImage Source="Images/Home.png" Tag="{Binding Id}" Width="48" Height="48" Margin="30,0,0,0" Visibility="{Binding HomeVisibility}" VerticalAlignment="Top" MouseLeftButtonDown="imgHome_Click"/>
                                <wb:ThemeableImage Source="Images/Office.png" Tag="{Binding Id}" Width="48" Height="48" Margin="30,0,0,0" Visibility="{Binding WorkVisibility}" VerticalAlignment="Top" MouseLeftButtonDown="imgWork_Click"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Canvas x:Name="peopcanvas" Visibility="Collapsed">
                    <TextBlock Canvas.Top="200" Foreground="White" Canvas.Left="50" FontSize="28" Width="381" TextWrapping="Wrap" Text="Add location in order to add people and associate them to that location" />
            </Canvas>

            </Grid>

        </phone:PanoramaItem>

        <!--Panorama item Messages-->
        <phone:PanoramaItem x:Name="panoramMessage">
            <phone:PanoramaItem.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="messages" Foreground="White"></TextBlock>
                    <wb:ThemeableImage Margin="60,20,0,0" Source="/Images/appbar.add.rest.png"  Width="48" Height="48" MouseLeftButtonDown="imgAddNewMessage_MouseLeftButtonDown"/>
                </StackPanel>
            </phone:PanoramaItem.Header>
            <Grid>
                <ListBox x:Name="lbxQuickMessages" ItemsSource="{Binding}" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel  Orientation="Horizontal" Height="90">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                        <toolkit:MenuItem Header="delete" Click="MenuItem_Click_4" Foreground="White"/>
                                        <toolkit:MenuItem Header="change location" Click="message_click" Foreground="White"/>
                                    </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                                <TextBlock  Tag="{Binding Id}" Foreground="White"  Text="{Binding Subject}" Margin="0,0,0,0" Width="360" FontSize="28" TextWrapping="Wrap"  MouseLeftButtonUp="MenuItem_Click_8" />
                                <Image   Source="{Binding ImgMessage}" Tag="{Binding Id}"  x:Name="SendMessage" Width="48" Height="48" VerticalAlignment="Top"  MouseLeftButtonDown="MenuItem_Click_9"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Canvas x:Name="msgcanvas" Visibility="Collapsed">
                    <TextBlock Canvas.Top="200" Canvas.Left="50" Foreground="White" FontSize="28" Width="381" TextWrapping="Wrap" Text="Add location in order to add Messages and associate them to that location" />
            </Canvas>
            </Grid>
        </phone:PanoramaItem>

        <!--Panorama item Links-->
        <phone:PanoramaItem x:Name="panoramaLinks">
            <phone:PanoramaItem.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="links" Foreground="White"></TextBlock>
                    <wb:ThemeableImage Margin="150,20,20,0" Source="/Images/appbar.add.rest.png" Width="48" Height="48" MouseLeftButtonDown="imgAddNewLinks_MouseLeftButtonDown"/>
                    <wb:ThemeableImage Margin="0,20,0,0" Source="/Images/appbar.feature.settings.rest.png" Width="48" Height="48" MouseLeftButtonDown="imgLinkSettings_MouseLeftButtonDown"/>
                </StackPanel>
            </phone:PanoramaItem.Header>
            <Grid>
                <ListBox x:Name="lbxQuickLinks"   ItemsSource="{Binding}" Margin="12,0,0,0" SelectionChanged="lbxQuickLinks_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Height="90">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                        <toolkit:MenuItem Header="delete"  Foreground="White" Click="MenuItem_Click_5"/>
                                        <toolkit:MenuItem Header="edit"  Foreground="White" Click="MenuItemlinkedit_Click"/>
                                        <toolkit:MenuItem Header="change location"  Foreground="White" Click="linkschangelocation_click"/>
                                    </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                                <TextBlock Text="{Binding Name}"  Foreground="White"  FontSize="28" Margin="0,0,0,0" TextWrapping="Wrap" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Canvas x:Name="linkscanvas" Visibility="Collapsed">
                    <TextBlock Canvas.Top="200" Canvas.Left="50"  Foreground="White" FontSize="28" Width="381" TextWrapping="Wrap" Text="Add location in order to add links and associate them to that location" />
            </Canvas>
            </Grid>
        </phone:PanoramaItem>

        <!--panoram To Do List page-->
        <phone:PanoramaItem x:Name="ToDoList">
            <phone:PanoramaItem.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="tasks" Foreground="White"></TextBlock>
                    <wb:ThemeableImage Source="/Images/appbar.add.rest.png" Margin="210,20,0,0" Width="48" Height="48" MouseLeftButtonDown="ThemeableToDoList_MouseLeftButtonDown"/>
                </StackPanel>
            </phone:PanoramaItem.Header>
            <Grid>
                <ListBox x:Name="lbxToDoList"  ItemsSource="{Binding}" SelectionChanged="lbxToDoList_SelectionChanged" Margin="15,0,0,0">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Height="90">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                        <toolkit:MenuItem Foreground="White" Header="change location" Click="todochangeLocation_click"/>
                                        <toolkit:MenuItem Foreground="White" Header="edit" Click="MenuItem_Click_10"/>
                                        <toolkit:MenuItem Foreground="White" Header="delete" Click="MenuItem_Click_6"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                                <TextBlock Foreground="White" Text="{Binding Name}" FontSize="28"  Width="220" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Canvas x:Name="taskcanvas" Visibility="Collapsed">
                    <TextBlock Foreground="White" Canvas.Top="200" Canvas.Left="50" FontSize="28" Width="381" TextWrapping="Wrap" Text="Add location in order to add tasks and associate them to that location" />
            </Canvas>
            </Grid>
        </phone:PanoramaItem>
        <!--Quick task places page-->

        <phone:PanoramaItem x:Name="Places">
            <phone:PanoramaItem.Header>
                <StackPanel Orientation="Horizontal"  Width="410">
                    <TextBlock Text="locations" Foreground="White"></TextBlock>
                    <wb:ThemeableImage Margin="20,20,20,0" Source="/Images/appbar.add.rest.png"  Width="48" Height="48" MouseLeftButtonDown="imgAddAddress_MouseLeftButtonDown"/>
                    <wb:ThemeableImage Margin="-5,20,0,0" Source="/Images/appbar.feature.settings.rest.png" Width="48" Height="48" MouseLeftButtonDown="imgAddSettings_MouseLeftButtonDown"/>
                </StackPanel>
            </phone:PanoramaItem.Header>
            <Grid>
                <ListBox x:Name="lbxAddresslist"   ItemsSource="{Binding}" ScrollViewer.VerticalScrollBarVisibility="Hidden" toolkit:TiltEffect.IsTiltEnabled="True" Margin="15,0,0,0" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel x:Name="Stack1" Orientation="Horizontal" Height="90">
                                <toolkit:ContextMenuService.ContextMenu>
                                    <toolkit:ContextMenu  >
                                        <toolkit:MenuItem   Header="Set as Current Location"  Click="CurrentLocation_Click" />
                                        <toolkit:MenuItem  Header="Show Location in Map" Visibility="{Binding visible1}" Click="MenuItemsetaslocatio_Click" />
                                        <toolkit:MenuItem   Header="change background"  Click="MenuItemsetasbackground_Click"/>
                                        <toolkit:MenuItem   Header="edit" Visibility="{Binding visible1}" Click="MenuItem_Click"/>
                                        <toolkit:MenuItem   Header="delete" Click="MenuItem_Click_1" Visibility="{Binding visible1}"/>
                                    </toolkit:ContextMenu>
                                </toolkit:ContextMenuService.ContextMenu>
                                <TextBlock Tag="{Binding Id}"   Text="{Binding Name}" FontSize="28"  Width="200" TextWrapping="Wrap"  Foreground="{Binding colour}" />
                                <TextBlock Tag="{Binding Id}"   Text="{Binding City}" FontSize="28" Margin="-30,0,0,0"  Width="200" TextWrapping="Wrap" Foreground="{Binding colour}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>
        </phone:PanoramaItem>

        <!--panoram about page-->

        <phone:PanoramaItem >
            <phone:PanoramaItem.Header>
                <StackPanel Orientation="Horizontal"  Width="410" >
                    <TextBlock Text="about" Foreground="White"></TextBlock>
                    <wb:ThemeableImage Margin="150,15,0,0" Source="/Images/appbar.questionmark.rest.png" Width="48" Height="48" MouseLeftButtonDown="imghelp_MouseLeftButtonDown"/>
                </StackPanel>
            </phone:PanoramaItem.Header>
            <Grid x:Name="aboutusgrid" >
                <abt1:AboutUs/>
            </Grid>
        </phone:PanoramaItem>
    </phone:Panorama>
</phone:PhoneApplicationPage>